<%@Page Language="VB" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- #include file="style.inc" -->
</head>
<body>
<!--------------------------------------------------------------------------->
<span class="heading">The HTML Control ServerChange Event</span><p />

<form runat="server">

  <input id="MyText" type="text" value="OriginalValue"
         onserverchange="MyCode" runat="server" /> &nbsp;

  <select id="MyListBox" onserverchange="MyListCode" runat="server">
    <option value="Value 1">Option 1</option>
    <option value="Value 2">Option 2</option>
    <option value="Value 3">Option 3</option>
  </select> &nbsp;

  <input  id="MyCheckBox" type="checkbox"
         onserverchange="MyCode" runat="server" /> &nbsp;

  <input type="submit" value="Submit" />

</form>

<div id="divResult" runat="server" enableviewstate="false" /><p />
<div class="cite">Change the values in the controls and click 'Submit'</div>


<script runat="server">

   Sub MyCode(objSender As Object, objArgs As EventArgs)
     divResult.InnerHtml += "ServerChange event detected for control '" _
                         & objSender.ID & "'<br />"
   End Sub

   Sub MyListCode(objSender As Object, objArgs As EventArgs)
     divResult.InnerHtml += "ServerChange event detected for control '" _
                         & objSender.ID & "'<br />SelectedIndex is '" _
                         & objSender.SelectedIndex _
                         & "', selected item text is '" _
                         & objSender.Items(objSender.SelectedIndex).Text _
                         & "', selected item value is '" _
                         & objSender.Items(objSender.SelectedIndex).Value & "'<br />"
   End Sub

</script>

<!--------------------------------------------------------------------------->
<!-- #include file="foot.inc" -->
</body>
</html>

